
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--使用jstl 标签 先声明--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1>User jsp</h1>

<%--EL表达式--%>
${username}
${password}
${sex}

<%--session--%>
${sessionScope.username}


<%--c:if   c:foreach--%>
<%--test 表达式为true 显示  否则不显示--%>
<c:if test="${1<10}">
    1<10
</c:if>

<c:if test="${1>10}">
    1>10
</c:if>

<table border="1" cellspacing="0">
    <tr>
        <th>序号</th>
        <th>姓名</th>
        <th>年纪</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${list}" var="p" varStatus="idx">
        <tr>
            <td>${idx.count}</td>
            <td>${p.name}</td>
            <td>${p.age}</td>
            <td>查看</td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
